﻿using AttributeRouting.Web.Http;
//using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Water.Model;

namespace Water.RestService.Controllers
{
    public class BigValveController : ApiController
    {
        private BigValve bg;

        [POST("GetBigValves")]
        public IList<BigValve> PostGetBigValves(BigValveXjCondition bvc)
        {
            bg = new BigValve();
            return bg.GetBigValveInspection(bvc);
        }
        /*
        [POST("GetBigValvesCount")]
        public int PostGetBigValvesCount(BigValve info)
        {
            var where = BigValveWhere(info);
            int count = rep.LoadCount(where);
            return count;
        }
        */
        
        [POST("AddBigValve")]
        public bool PostAddBigValve(BigValve info)
        {
            info.MRNO = BuilderMrno.GetMrnoFortbl("Tbt_BigValve");
            bg = new BigValve();
            bool result = bg.AddBigValve(info) > 0 ? true : false;
            return result;
        }

        /*
        [POST("EditBigValve")]
        public bool PostEditBigValve(BigValve info)
        {
            bool result = rep.Edit(info);
            return result;
        }

        [GET("DeleteBigValve/{code}")]
        public bool GetDeleteBigValve(string code)
        {
            bool result = rep.Delete(code);
            return result;
        }

        [GET("GetBigValve/{code}")]
        public BigValve GetBigValve(string code)
        {
            var result = rep.Get(code);
            return result;
        }
         */
    }
}
